package com.example.testoink;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

public class Result extends Activity {
	
	public void goHome(View v){
		
	Intent intent = new Intent(Result.this,SelectStageActivity.class);
		
		startActivity(intent);
		
	}
	
	public void restart(View v){
		
		Intent intent = new Intent(Result.this,MainActivity.class);
		
		startActivity(intent);
		
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_result);
		
	RelativeLayout myLayout = (RelativeLayout)findViewById(R.id.result1);
		
		RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(1080,920);
		ImageView paper = new ImageView(this);
		
		String result = getIntent().getStringExtra("Result");
		
		if(result.equals("Won")){
		
		paper.setImageResource( R.drawable.won ); }else if(result.equals("Lose")){
			
			paper.setImageResource( R.drawable.lose );	
			
		}
		paper.setX(400);
		paper.setY(0);
		
		paper.bringToFront();
		//grass.setId(100+grassSlot);
		myLayout.addView(paper, params);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.result, menu);
		
	
		
		return true;
	}

}
